import axios from 'axios'

// axios.defaults.baseURL='http://adminv2.happymmall.com/'

axios.interceptors.request.use(config=>{
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
},err=>{
  return Promise.reject(err);
})


let Request = (params)=>{
    return new Promise((resolve,reject)=>{
        axios({
            ...params
        }).then((res)=>{
            resolve(res)
        }).catch(err=>{
            reject(err)
        })
    })
}

export default Request